package com.xxxtentacion.mr.exam.step2;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;
/**
 * @author urboifrdscks!
 */
public class ExamReducer extends Reducer<ExamBean, NullWritable, IntWritable,ExamBean> {
    int count=1;
    private IntWritable total = new IntWritable();
    @Override
    protected void reduce(ExamBean key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
        for (NullWritable value : values) {
            total.set(count);
            context.write(total,key);
            count++;
        }

    }
}
